package com.woniuxy.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.woniuxy.entity.Shop;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 店铺Mapper接口
 */
public interface ShopMapper extends BaseMapper<Shop> {

    @Select("select * from gfr_shop where name like '%${keyword}%'")
    Shop search(String keyword);
    //根据行政区id取得行政区名后模糊查询店铺地址返回店铺列表
    @Select("select s.* from gfr_shop s,gfr_region r where  s.address like concat('%',r.region,'%') and r.id = #{rid}")
    List<Shop> getByRegionId(int rid);
}
